
#ifndef EVENTCONVERT_H
#define EVENTCONVERT_H

#include <BHandler>
#include <BCamera>
#include <BViewer>
#include <BPicker>
#include <BPixmap>
#include <BMouseEvent>

using namespace BWE;

class PixmapHandler : public BHandler
{
public:
	PixmapHandler(BGeometry* screen);

protected:
	void slotDisplayFreshed();
	void slotWidgetHiden();

protected:
	virtual void event(const BEvent& event);
	virtual void paint(BPainter& painter);
	virtual void render(BRender& render);

	virtual void updateEvent(const BEvent& event);

	virtual void mouseEnterEvent(const BMouseEvent& mouseEvent);
	virtual void mouseLeaveEvent(const BMouseEvent& mouseEvent);
	virtual void mousePressEvent(const BMouseEvent& mouseEvent);
	virtual void mouseReleaseEvent(const BMouseEvent& mouseEvent);
	virtual void mouseMoveEvent(const BMouseEvent& mouseEvent);

	virtual void mouseWheelEvent(const BMouseEvent& mouseEvent);
	virtual void mouseClickEvent(const BMouseEvent& mouseEvent);
	virtual void mouseDoubleClickEvent(const BMouseEvent& mouseEvent);

	virtual void dragEnterEvent(const BMouseEvent& mouseEvent);
	virtual void dragLeaveEvent(const BMouseEvent& mouseEvent);
	virtual void dragMoveEvent(const BMouseEvent& mouseEvent);
	virtual void dragDropEvent(const BMouseEvent& mouseEvent);

private:
	BGeometry*		_screen;
	BPixmap*		_pixmap;
	BWidget*		_widget;
	bool			_inside;
	bool			_pressed;

	BPoint			_debugPoint;
	BVector			_debugVector;
	BLine			_debugLine;
	BMouseEvent		_mouseEvent;
};

#endif